import axios from '@/common/plugins/Axios'

export default {
    // 获取代办工作项
    getAllWork: () => {
        return axios.request({
            url: `/apprManage/getAllWork`,
            method: 'get'
        })
    },
    // 获取我的申请
    getMyApprDetail: (page :number ,size:number) => {
        return axios.request({
            url: `/apprManage/getMyApprDetail`,
            method: 'get',
            params:{
                size:size,
                page:page
            }
        })
    },
    // 获取已办工作项
    getMyProcessed: (page :number ,size:number) => {
        return axios.request({
            url: `/apprManage/getMyProcessed`,
            method: 'get',
            params:{
                size:size,
                page:page
            }
        })
    },
    // 获取审批意见
    getProcessMind: (processCode: String,processInstId : number) => {
        return axios.request({
            url: `/apprManage/getProcessMind`,
            method: 'get',
            params:{
                processCode: processCode,
                processInstId: processInstId 
            }
        })
    },
    //获取审批草稿详情
    getApprDetail: (apprId : number) => {
        return axios.request({
            url: `/apprManage/getApprDetail`,
            method: 'get',
            params:{
                apprId: apprId
            }
        })
    },
    // 获取流程图信息
    getProcessDetail: (processCode:String) => {
        return axios.request({
            url: `/apprManage/getProcessDetail`,
            method: 'get',
            params:{
                processCode: processCode
            }
        })
    },
    endWork:(work:object)=>{
        return axios.request({
            url: `/work/endWork`,
            method: 'post',
            data:work
        })
    },
    getStageList:()=>{
        return axios.request({
            url: `/apprManage/getStageList`,
            method: 'get'
        })
    }
}
